package com.megamusic.findshow.dao;

import com.megamusic.findshow.domain.entity.Artist;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;

/**
 * Created by maita on 17/8/14.
 */
public interface ArtistRepository extends JpaRepository<Artist,Long> {

    Artist findByIdAndIsDeleted(Long id,Integer isDeleted);
    Page<Artist> findByIsDeleted(Integer isDeleted,Pageable pageable);

    Page<Artist> findByIsDeletedAndNameLike(Integer isDeleted,String name,Pageable pageable);

    Page<Artist> findByCategoryIdAndIsDeleted(Long cateId,Integer isDeleted,Pageable pageable);


    Page<Artist> findByNewProvinceAndNewCityAndIsDeletedAndNameLike(String newProvinceName,String newCityName,
                                                         Integer isDeleted,Pageable pageable,String name);

    Page<Artist> findByNewProvinceAndNewCityAndIsDeleted(String newProvinceName,String newCityName,
                                                         Integer isDeleted,Pageable pageable);

    Page<Artist> findByNewProvinceAndNewCityAndCategoryIdAndIsDeletedAndNameLike(String newProvinceName,String newCityName,
                                                                      Long cateId,Integer isDeleted,Pageable pageable,String name);

    Page<Artist> findByNewProvinceAndNewCityAndCategoryIdAndIsDeleted(String newProvinceName,String newCityName,
                                                                      Long cateId,Integer isDeleted,Pageable pageable);


}
